<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>展示Es6新特性</title>
		<script type="text/javascript">
			var a = 10; //js重复定义变量名称,它不报错,它会覆盖以前值
			{
				var a = 20;
				console.log(a);
			}
			console.log(a);
			
			let b =10;//let作用域支持块级别,var全局,它不支持块
			{
				let b =100;//创建新的b,它不会覆盖外部定义b,出了块b就消失
				console.log(b);
			}
			console.log(b);
			
			// const x =10;
			// x =20;
			// console.log(x);
			
			//新语法,拉姆达表达式,Es6中习惯箭头函数(=>) 语法简洁
			
			
		</script>
	</head>
	<body>
	</body>
</html>
